package com.kingyea.mobilepolice.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author Mr.Lin
 * @version v1.0.0
 * @description
 * @date Created in 2018/4/15 22:51
 */
//@Component
@ConfigurationProperties(prefix = "kingyea.mobilepolice")
public class GlobalVarComm {

    /**
     * 内外网
     */
    public final static int insideWai = 1;
    public final static int insideNei = 2;
    public final static String TOKENNAME = "token";
    public final static String ACCESS_TOKENNAME = "access_token";
    public final static String CHARSET_UTF8 = "UTF-8";
    /**
     * 当前系统所在网域 1网外 2网内  inside
     */
    public static Integer inside;
    /**
     * 边界外 ZUUL 网关地址 externalAddress
     */
    public static String externalAddress;
    /**
     * 边界内 ZUUL 网关地址 insideAddress
     */
    public static String insideAddress;

    public static Integer getInside() {
        return inside;
    }

    @Value("${kingyea.mobilepolice.inside}")
    public void setInside(Integer inside) {
        GlobalVarComm.inside = inside;
    }

    public static String getExternalAddress() {
        return externalAddress;
    }

    @Value("${kingyea.mobilepolice.externalAddress}")
    public void setExternalAddress(String externalAddress) {
        GlobalVarComm.externalAddress = externalAddress;
    }

    public static String getInsideAddress() {
        return insideAddress;
    }

    @Value("${kingyea.mobilepolice.insideAddress}")
    public void setInsideAddress(String insideAddress) {
        GlobalVarComm.insideAddress = insideAddress;
    }

    public static int getInsideWai() {
        return insideWai;
    }

    public static int getInsideNei() {
        return insideNei;
    }

    public static String getTOKENNAME() {
        return TOKENNAME;
    }

    public static String getCharsetUtf8() {
        return CHARSET_UTF8;
    }
}
